#include<stdio.h>
int Sumarr(int* arr, int len)
{
    int res = 0;
    for (int i = 0; i < len; i++) //从头开始遍历
	{
        for (int j = 1; j <=len- i ; j += 2) 
        //当前情况下的1,3,5..长度类型的子数组
		{
            for (int m = i; m < i + j; m++)//输出当前的子数组的值
			{
                res = res + arr[m];//累加值
            }
        }
    }
    return res;//返回最后累加后的值
}

int main()
{
	int arr[]={10,11,12};
	printf("%d\n",Sumarr(arr,sizeof(arr)/sizeof(arr[0])));
	return 0;
}
